
class Channel {
  /** @type {string} */
  name;
  /** @type {Note[]} */
  notes = [];

  /**
   * @param {string} name 
   */
  constructor(name) {
    this.name = name;
  }
}

class Note {
  /** @type {number} */
  time;
  /** @type {boolean} 没声音时为 false */
  enable;
  /** @type {number} 0-1 */
  volume;
  /** @type {number} 音调, 0-96, 有小数 */
  note;
  /** @type {number} 音色 */
  duty;

  /**
   * @param {number} time 
   * @param {number} volume 
   * @param {number} note 
   * @param {number} duty 
   * @param {boolean} enable 
   */
  constructor(time, volume, note, duty, enable=true) {
    this.time = time;
    this.volume = volume;
    this.note = note;
    this.duty = duty;
    this.enable = enable;
  }
}

export {
  Channel,
  Note
};
